//
//  scrollTouchViewController.m
//  scrollTouch
//
//  Created by wangjun on 11-6-1.
//  Copyright 2011年 __MyCompanyName__. All rights reserved.
//

#import "scrollTouchViewController.h"

#import "myScrollView.h"

@implementation scrollTouchViewController

- (void)dealloc
{
    [super dealloc];
}

- (void)didReceiveMemoryWarning
{
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
    
    // Release any cached data, images, etc that aren't in use.
}

#pragma mark - View lifecycle

// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad
{
    [super viewDidLoad];
    
    myScrollView *view=[[myScrollView alloc] initWithFrame:CGRectMake(10, 9, 300, 400)];
    [view setUserInteractionEnabled:YES];
    [view setScrollEnabled:YES];
    
    //NO 发送滚动的通知 但是就算手指移动 scroll也不会动了 YES 发送通知 scroo可以移动
    [view setCanCancelContentTouches:YES];
    [view setBounces:NO];
    // NO 立即通知touchesShouldBegin:withEvent:inContentView 看是否滚动 scroll
    [view setDelaysContentTouches:NO];
    [view setContentSize:CGSizeMake(300, 900)];
    [self.view addSubview:view];
    [view release];
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

@end
